<extend name="Common@Layout:layui" />
<block name="title">
    <title></title>
</block>
<block name="style">
    <style>
        .img-wrap {
            width: 500px;
            height: 250px;
            display: table-cell;
            vertical-align: middle;
            text-align: center;
            border: 1px dashed #ccc;
            cursor: pointer;
        }
        
        .img-wrap img {
            width: 100%;
            height: 100%;
        }
        
        .pd-20 {
            padding: 20px;
        }
        
        .layui-input {
            width: 300px;
        }
    </style>
</block>

<block name="main">
    <div class="pd-20">
        <form class="layui-form close-dialog" method="post" action="img_edit_post">
            <input name="id" type="hidden" value="{$_GET['id']}">
            <input name="pid" type="hidden" value="{$pid}">
            <div class="layui-form-item">
                <label class="layui-form-label">标题：</label>
                <div class="layui-input-block">
                    <input type="text" name="title" value="{$info.title}" placeholder="请输入标题，非必需" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">链接地址：</label>
                <div class="layui-input-block">
                    <input type="text" name="url" value="{$info.url}" placeholder="请输入链接地址，非必需" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline" style="width:360px">
                    <label class="layui-form-label">状态：</label>
                    <div class="layui-input-block">
                        <php>if(!$info) $info['status'] = 1;</php>
                        <input class="lab" type="radio" name="status" title="启用" value="1" <eq name="info['status']" value="1">checked</eq>>
                        <input class="lab" type="radio" name="status" title="停用" value="0" <eq name="info['status']" value="0">checked</eq>>
                    </div>
                </div>
                <div class="layui-inline" style="width:360px">
                    <label class="layui-form-label">排序值：</label>
                    <div class="layui-input-block">
                        <input type="number" name="listorder" value="{$info.listorder|default=0}" class="layui-input" />
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">图片</label>
                <div class="layui-input-block">
                    <input type="text" id="fengmian" name="img" style="width:500px;display:inline-block" value="{$info.img}" placeholder="请输入图片地址" class="layui-input">
                    <input type="file" name="file" lay-type="image" class="" id="fengmianupload" class="layui-upload-file">
                </div>
                <div style="padding-top:10px;margin-left:110px;">
                    <div class="img-wrap" id="fengmian-box" style="background:#f8f8f8;text-align:center;">
                        <span style="font-size:60px;line-height:207px;color:#eee;">预览</span>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="*">立即提交</button>
                </div>
            </div>
        </form>
    </div>
</block>

<block name="script">
    <script>
        layui.use(['jquery', 'content'], function() {

        });
    </script>
</block>